home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / gedscripts / ispell / wordcheck.ged < prev    next >
Text File  |  1995-03-09  |  2KB  |  69 lines

  1. /*
  2.  * WordCheck.ged - a prog to check the word you just typed with GUIspell
  3.  * needs GoldED 0.97, GUIspell 1.1 (I make it appear on GoldED screen)
  4.  * and of course the Ispell in Rexx Server mode
  5.  *
  6.  * Done by Rene Laederach
  7.  *
  8.  * © 1994 by Rene Laederach, FreeWare
  9.  *
  10.  * Startup and closedown of script by Dietmar Eilert
  11.  *
  12.  * taken straight from `empty.ged'
  13.  *
  14.  * Actually quite simple to implement a check routine. Why had LJR such an
  15.  * impractical solution that was incredibly complicated?
  16.  *
  17.  */
  18.  
  19. OPTIONS RESULTS                             /* enable return codes     */
  20.  
  21. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  22.     address 'GOLDED.1'
  23.  
  24. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  25. OPTIONS FAILAT 6                            /* ignore warnings         */
  26. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  27.  
  28. if ~show(ports, 'IRexxSpell') then  /* Change the path to your setup */
  29.   do
  30.     address command 'run <nil: >nil: prg:ispell -r >nil: <nil:'
  31.     address command waitforport 'IRexxSpell'
  32.   end
  33.  
  34. 'LEFT'
  35. 'LEFT'
  36. 'QUERY WORD'
  37. testword = result
  38.  
  39. item = compress(testword, ' ~`,./<>?;:"[]{}!@#$%^&*()+|=\' )
  40.  
  41. address 'IRexxSpell' quickcheck item
  42. IF RESULT = 'bad' THEN DO
  43.     IF ~show(ports, 'GUISpell') THEN DO
  44.         ADDRESS COMMAND 'run <nil: >nil: prg:GUISpell <nil: >nil:'
  45.         ADDRESS COMMAND waitforport 'GUISpell'
  46.         end
  47.     ADDRESS "GUISpell"
  48.     CHECKCALLBACKHOOK 'rexx:GoldED/WordCheckCallBack.ged' testword item
  49.     CHECK item
  50.  
  51. END
  52.     else DO
  53.     ADDRESS "GOLDED.1"
  54.     'RIGHT'             /* Word was OK so I move cursor back into position */
  55.     'RIGHT'
  56.     END
  57.  
  58. ADDRESS "GOLDED.1"
  59.  
  60. 'UNLOCK' /* VERY important: unlock GUI */
  61. EXIT
  62.  
  63. SYNTAX:
  64.  
  65. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  66. 'UNLOCK'
  67. EXIT
  68.  
  69.